FROM centos:7
MAINTAINER chenleji@wise2c.com

RUN yum-config-manager --add-repo https://openresty.org/yum/centos/OpenResty.repo \
    && yum install -y epel-release.noarch \
    && yum install -y openresty redis \
    && yum install -y wget tcpdump net-tools

RUN mkdir s6; mkdir -p /var/logs \
    && wget --no-check-certificate  https://github.com/just-containers/skaware/releases/download/v1.16.1/s6-2.2.2.0-linux-amd64-bin.tar.gz \
    && tar -xvzf s6-2.2.2.0-linux-amd64-bin.tar.gz --directory /s6 --strip-components=1 \
    && mv /s6/usr/bin/* /usr/bin \
    && chmod -R 755 /usr/bin \
    && rm -rf s6-2.2.2.0-linux-amd64-bin.tar.gz s6

COPY . /loadbalance/
ENTRYPOINT ["/usr/bin/s6-svscan","/loadbalance/service"]